1. Field of the Invention
The present invention relates to an image processor which compresses image data and stores the compressed data in an image memory.
2. Description of the Prior Art
An image processor provided in a digital copying machine or the like reads a document image and stores the image data in an image memory. Then, an edition/operation of the image data is performed on the image data stored in the image memory. For example, automatic exposure is performed for correcting density distribution of an image of a document to be reproduced on a sheet of paper according to an attribute of the image of the document. The image processor may also perform edition of the image such as color change or frame edition. The attribute of image may be decided in real time, for example, by sampling image data and performing fast speed operation of the sampled image data at the same time as reading the image. It may also be decided by using image data stored in a memory device, for example, in the unit of a pixel matrix. It is also proposed to decide attribute in a pixel matrix including a pixel of interest.
Recently, generalized block truncation coding (GBTC) is proposed for compressing image data of a document. In generalized block truncation coding, image data is divided into pixel blocks having a predetermined matrix size, and various data such as an average data, gradation width index and code data are obtained for each block of the image data. These data reflect pixel data and gradation width of pixels in a block. Generalized block truncation coding is also proposed to be used for image data of L*a*b* colorimetric system. In an example, 8-bit image data in a 4*4 pixel block are converted to gradation width index LD, the average data LA and 2-bit code data .PHI..sub.ij. When the data is decoded, the code data .PHI..sub.ij is converted to one of four values of 256 gradation levels specified by the gradation width index LD and the average data LA. The decoded data includes an error somewhat if compared with the image data before coding because the number of the gradation levels becomes smaller. If a color of a pixel at an edge of a document is reproduced, the reproduced color is different from the original color. However, if data of L*a*b* colorimetric system are used, even though the decoded data includes an error, lightness and chromaticities are changed only somewhat, and the reproduced color is not different at an edge of a document image.
In JPEG (Joint Picture Experts Group) standard which uses Huffman code data obtained by using discrete cosine transformation of image data, a compression ratio of data varies with a type of document. The compression ratio may be better than that of generalized block truncation coding (GBTC) in some documents, but the image data may not be compressed actually for some documents. Then, it is difficult to set an appropriate storage capacity to be provided in the image processor. On the other hand, an advantage of GBTC is that the compression ratio of GBTC is constant, and it is easy to determine a storage capacity therefor.
Attributes of an image can be decided not in correspondence to image data of red, green and blue, but to data determined by generalized block truncation coding. Therefore, it is an advantage that attributes can also be determined according to coded data obtained by generalized block truncation coding of an amount much smaller than the image data. However, there are problems to be solved when attributes of an image are decided by using the data obtained by coding the image data.
In an image processor where the attribute is decided in real time, sampling and sampling speed have problems. The number of sampled image data and the content of processing are limited by operation speed. On the other hand, in an apparatus where the attribute is decided according to the image data stored in a storage device, a large storage capacity and a long processing time are needed. Further, if the attribute of image data for a block including the pixel of interest is decided, many line buffers are needed to use information on adjacent pixels in a broad range of blocks.
It is also a problem that the compression ratio of generalized block truncation coding is not so high if compared with that of JPEG standard though it is constant as mentioned above. Then, it is preferable that the storage capacity of an image memory is decreased further.
Further, in an image processor using GBTC, the type of a document is decided before coding the image data or after decoding the code data. Operation such as automatic exposure or edition such as color change is also performed before coding the image data or after decoding the code data. Then, a hardware circuit for fast speed operation is needed to decide the attribute of image, and a storage device of a large capacity for storing all the image data is needed.
There is also a problem on discrimination of a character image area in a document image. A character image area can be discriminated by detecting a sharp change in gradation at an edge portion of a character. However, the change may be decided erroneously due to a decrease in resolution caused by the read precision of image data, aberration of a lens and the like and to a blur of color around an edge portion of a character image. In order to prevent erroneous decision, a complicated device is needed, and a circuit for the processing has a large scale. This situation also holds for an image processor using generalized block truncation coding.